<template>
	<view style="position: relative;width: 100%;">
		<view style="text-align: center;width: 100%;color: #EE7B30;font-size: 26.58rpx;letter-spacing: 2rpx;margin-top: 126.24rpx;font-weight: bold;">请选择您的当前身份</view>
		<view style="position: absolute;top: 170rpx;">
			<view v-for="(itme,index) in xuance" :key="index" style="height: 260rpx;width: 694.6rpx;background: #FFFFFF;border-radius: 24.15rpx;margin-left: 27.77rpx;margin-bottom: 46.51rpx;display: flex;align-items: center;" @tap="ranse(index,itme.name)">
				<image :src="itme.img" mode="" style="width: 69.45rpx;height: 69.45rpx;margin-left:170rpx ;"></image>
				<view style="font-size: 29rpx;color: #383838;font-weight: bold;margin-left:48.32rpx ;">{{itme.name}}</view>
				<view style="width: 46.57rpx;height:46.57rpx ;border: 2px solid #EE7B30;border-radius: 50%;margin-left:195.7rpx ;" v-if="num != index"></view>
				<view style="width: 46.57rpx;height:46.57rpx ;border: 1px solid #EE7B30;border-radius: 50%;margin-left:195.7rpx ;" v-if="num == index">
					<image :src="img" style="width: 46.57rpx;height:46.57rpx ;"></image>
				</view>
			</view>
		</view>
		<view style="width: 648.7rpx;height: 85.76rpx;background:#EE7B30 ;border-radius: 42.9rpx;color: #FFFFFF;font-size: 29rpx;text-align: center;line-height:85.76rpx;position: fixed;bottom: 103.28rpx;left: 50.73rpx;" @tap="tiaozhuan">
			确定
		</view>
		<view></view>
	</view>
</template>
<script>
	export default {
		data() {
			return {
				num:2,
				dad:{},
				shenfen:"",
				xuance:[
					{
					name:"我是用户",
					img:"http://img.curiousmore.com/752801"
				},
					{
					name:"我是机构",
					img:"http://img.curiousmore.com/26657"
				},
				],
				img: "http://img.curiousmore.com/29068"
			}
		},
		methods:{
			ranse(index,name){
				// 身份 33 学生  55 机构
				this.num = index
				if(name == "我是用户"){
					this.shenfen = 33
				}else{
					this.shenfen = 55
				}
				try{
					uni.setStorageSync('shenfen_',this.shenfen)
				}catch(e){console.log(e)} 
			},
			tiaozhuan(){
			    try{
				const a = uni.getStorageSync('shenfen_')
				}catch(e){}
				uni.redirectTo({
					url:"/pages/tabBer/newsshouye/newsshouye"
				})
			}
		},
		onLoad() {
			try{
				if(uni.getStorageSync('userif_list')){
					this.dad = uni.getStorageSync('userif_list')
				}
				if(uni.getStorageSync('shenfen_')){
					this.shenfen = uni.getStorageSync('shenfen_')
					if(this.shenfen == 33){
						this.num = 0
					}else if(this.shenfen == 55){
						this.num = 1
					}
				}else{
					this.num = 0
				}
			}catch(e){}
		},
		onShow() {
			
		}
	}
</script>
<style>
	.num{
		background: #EE7B30;
	}
</style>